package com.it.park.rms.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.it.park.rms.client.model.Menu;
import com.it.park.rms.client.service.MenuService;
import com.it.park.rms.dao.MenuMapper;
import com.it.park.rms.service.impl.base.BaseServiceImpl;

@Service("menuService")
public class MenuServiceImpl extends BaseServiceImpl<Menu> implements MenuService {
	
	@Autowired
	private MenuMapper menuMapper;

	@Override
	public boolean deleteByPrimaryKey(Integer id) {
		return menuMapper.deleteByPrimaryKey(id)==1;
	}

	@Override
	public boolean insert(Menu record) {
		return menuMapper.insert(record)==1;
	}

	@Override
	public boolean insertSelective(Menu record) {
		return menuMapper.insertSelective(record)==1;
	}

	@Override
	public Menu selectByPrimaryKey(Integer id) {
		return menuMapper.selectByPrimaryKey(id);
	}

	@Override
	public boolean updateByPrimaryKeySelective(Menu record) {
		return menuMapper.updateByPrimaryKeySelective(record)==1;
	}

	@Override
	public boolean updateByPrimaryKey(Menu record) {
		return menuMapper.updateByPrimaryKey(record)==1;
	}

	@Override
	public List<Menu> listMenus(Menu menu) {
		return menuMapper.listMenus(menu);
	}

	@Override
	public List<Menu> selectAll() {
		return menuMapper.selectAll();
	}

	@Override
	public boolean updateState(Integer menuID) {
		return menuMapper.updateState(menuID)==1;
	}

	@Override
	public List<Menu> selectPagination(Menu t) {
		return menuMapper.selectPagination(t);
	}

	@Override
	public Integer selectTotal(Menu t) {
		return menuMapper.selectTotal(t);
	}

	@Override
	public Integer selectMaxSort(Integer pid) {
		return menuMapper.selectMaxSort(pid);
	}

	@Override
	public boolean deleteByModel(Menu t) {
		return menuMapper.deleteByModel(t)==1;
	}

}
